<template>
  <div>
    <el-descriptions
      class="margin-top"
      title="采购信息"
      :column="2"
      size="small"
      border
      v-if="id != null"
    >
      <el-descriptions-item label="采购验收单号">
        <i class="el-icon-document-checked" />
        {{ form.applicationNum }}
      </el-descriptions-item>
      <el-descriptions-item label="验收日期">
        <i class="el-icon-date" />
        {{ form.acceptanceDate }}
      </el-descriptions-item>
      <el-descriptions-item label="验收人">
        <i class="el-icon-user" /> {{ form.acceptorName }}
      </el-descriptions-item>
      <el-descriptions-item label="验收部门">
        <i class="el-icon-office-building" />
        {{ form.acceptDepartName }}
      </el-descriptions-item>
      <el-descriptions-item label="采购订单号">
        <i class="el-icon-document" /> {{ form.orderNum }}
      </el-descriptions-item>
      <el-descriptions-item label="采购日期">
        <i class="el-icon-date" /> {{ form.purchaseDate }}
      </el-descriptions-item>
      <el-descriptions-item label="到货日期">
        <i class="el-icon-date" /> {{ form.arrivalDate }}
      </el-descriptions-item>
      <el-descriptions-item label="采购人">
        <i class="el-icon-user-solid" /> {{ form.buyerName }}
      </el-descriptions-item>
      <el-descriptions-item label="采购部门">
        <i class="el-icon-s-grid" /> {{ form.departName }}
      </el-descriptions-item>
      <el-descriptions-item label="供应商名称">
        <i class="el-icon-truck" /> {{ form.supplierName }}
      </el-descriptions-item>
      <el-descriptions-item label="供应商联系人">
        <i class="el-icon-user" /> {{ form.supplierPersonnelName }}
      </el-descriptions-item>
      <el-descriptions-item label="供应商联系电话">
        <i class="el-icon-phone" /> {{ form.supplierPersonnelPhone }}
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
import { fixedAsset } from "@/api/fixedAsset";
export default {
  props: ["id"],
  data() {
    return {
      form: {
        applicationNum: "", // 采购验收单号
        acceptanceDate: new Date(), // 验收日期
        acceptorName: "", // 验收人
        acceptDepartName: "", // 验收部门
        orderNum: "", // 采购订单号
        purchaseDate: "", // 采购日期
        arrivalDate: "", // 到货日期
        buyerName: "", // 采购人
        departName: "", // 采购部门
        supplierName: "", // 供应商名称
        supplierPersonnelName: "", // 供应商联系人
        supplierPersonnelPhone: "", // 供应商联系电话
      },
    };
  },
  created() {
    this.getAcceptFixedAsset();
  },
  methods: {
    getAcceptFixedAsset() {
      fixedAsset.findAcceptance(this.id).then((res) => {
        this.form = res.data;
      });
    },
  },
};
</script>

<style scoped></style>
